/*
 * Hibiscus is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 3 of the License,
 * or (at your option) any later version.
 *
 * Hibiscus is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Hibiscus; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 *
 * Copyright (C) 2003 Tetete - http://tetete.hu.
 */
package hu.tetete.hibiscus;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * TODO javadoc.
 */
public class BarniTestActivity extends Activity {

    private static final String TAG = BarniTestActivity.class.getName();

    /** TODO javadoc. */
    public static final String TEXT_CONTENT_INTENT_EXTRA = "text_content_intent_extra";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Log.i(TAG, "Intent caused this oncreate: " + getIntent());
        Log.i(TAG, "Calling activity: " + getCallingActivity());

        final Intent incomeIntent = getIntent();
        final String textContent = incomeIntent.getExtras().getString(BarniTestActivity.TEXT_CONTENT_INTENT_EXTRA);

        setContentView(R.layout.main);

        final TextView textView = new TextView(this);
        textView.setText(textContent);

        final LinearLayout mainContent = (LinearLayout)findViewById(R.id.testLayout);
        mainContent.addView(textView);

    }



    /**
     * @see android.app.Activity#onActivityResult(int, int, android.content.Intent)
     */
    @Override
    protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Log.i(TAG, "RequestCode: " + requestCode + " ResultCode: " + resultCode);
    }
}
